<%--
  Created by IntelliJ IDEA.
  User: dzw
  Date: 2018/3/20
  Time: 9:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<div id="page-content">
  <div class="row">
    <div class="col-lg-12">
      <div class="panel">
        <div class="panel-heading">
          <h3 class="panel-title">数据导入</h3>
        </div>

        <div class="panel-body" style="display: none">
          <button class="btn btn-success import" id="importNation">导入民族字典</button>
          <button class="btn btn-success import" id="importStreet">导入街道字典 和 居民区配置</button>
          <button class="btn btn-success import" id="importEdu">导入学历字典</button>
          <button class="btn btn-success import" id="importPersonNature">导入人员性质（书记）</button>
          <button class="btn btn-success import" id="importDirectorPersonNature">导入人员性质（主任）</button>
          <button class="btn btn-success import" id="importWorkNature">导入工作性质</button>
          <button class="btn btn-danger import" id="importPerson">导入人员（书记）</button>
          <button class="btn btn-danger import" id="importDirector">导入人员（主任）</button>
        </div>

      </div>
    </div>
  </div>
</div>

<script>

  $(".import").click(function(){
    $(this).attr("disabled", true);
    var name = $(this).attr("id");
    __ajax_post("<%=path%>/com/data/"+name,{},function(data){
      if(data.state==1){
        __toastr_success(data.message);
      }else{
        __toastr_error(data.message);
      }
      console.log(data);
    })
  });



</script>